package org.eclipse.wtp.puzzled;

import static org.junit.Assert.*;

import org.eclipse.wtp.puzzled.MySQLAccess;
import org.eclipse.wtp.puzzled.User;

import org.junit.Test;

public class DatabaseTest {

	@Test
	public void test() {
		if(1==0)
			fail("Not yet implemented");
		String fname = "Alex";
		String lname ="Dro";
		String email= "DREW@CO";
		String uname= "D";
		
		User u = new User(fname, lname, email, uname);
	
		if(!u.getFirstName().equals(fname))
			fail("First name was not entered correctly");
		if(!u.getLastName().equals(lname))
			fail("Last Name not entered correctly");
		if(!u.getEmail().equals(email))
			fail("Email not set right");
		if(!u.getUserName().equals(uname))
			fail("UserName not set right");
		u.setFirstName("Charlie");
		u.setLastName("Poop");
		u.setEmail("POOP@POOPY");
		u.setUserName("Poop");
		if(!u.getFirstName().equals("Charlie"))
			fail("First name was not entered correctly");
		if(!u.getLastName().equals("Poop"))
			fail("Last Name not entered correctly");
		if(!u.getEmail().equals("POOP@POOPY"))
			fail("Email not set right");
		if(!u.getUserName().equals("Poop"))
			fail("UserName not set right");
		u.setPoints(3);
	
		if(u.getPoints()!=3)
			fail("The points where not set");
	//MYSQL Access Part
		try{
			MySQLAccess msa = new MySQLAccess();
			//msa.readDataBase();
			msa.createUser("Alex", "Alex","Alex","Alex", "Alex");
			msa.authenticate("Alex", "Alex");
			msa.updatePoints("Alex", 49012);
			msa.getHighScores();
		}catch (Exception e){
			
		}
		
	}
	
}


